<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="/Public/css/pintuer.css">
<link rel="stylesheet" href="/Public/css/admin.css">
<script src="/Public/js/jquery.js"></script>
<script src="/Public/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 友链列表</strong></div>
  <div class="padding border-bottom">
    <button type="button" class="button border-yellow" onclick="window.location.href='/Admin/Link/create'"><span class="icon-plus-square-o"></span> 添加链接</button>
  </div>
  <form method="post" action="" id="listform">
  <table class="table table-hover text-center">
    <tr>
      <th width="5%">ID</th>
      <th width="15%">网站名称</th>
      <th width="10%">排序</th>
      <th width="10%">操作</th>
    </tr>
    <?php if(is_array($list)): foreach($list as $key=>$item): ?><tr>
      <td><?php echo ($item["id"]); ?></td>
      <td><?php echo ($item["name"]); ?></td>
      <td><?php echo ($item["sort"]); ?></td>
      <td><div class="button-group"> <a class="button border-main" href="/Admin/Link/edit/id/<?php echo ($item["id"]); ?>.html"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="javascript:void(0)" onclick="return del(<?php echo ($item["id"]); ?>)"><span class="icon-trash-o"></span> 删除</a> </div></td>
    </tr><?php endforeach; endif; ?>
     <tr>
        <td colspan="8" class="page-list"><div class="pagelist"> <?php echo ($page); ?> </div></td>
      </tr>
  </table>
  </form>
</div>
<script type="text/javascript">
//单个删除
function del(id){
	if(confirm("您确定要删除吗?")){
		
		$("#listform").attr("action","/Admin/Link/del/id/"+id+".html");
		$("#listform").submit();	
		
	}
}
</script>

</body>
</html>